<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>dom使用举例</title>
    <script src="js/dom.js"></script>
</head>
<body>
<select id="sltCity">

</select>
</body>
<script>

 var cities = getCities();

 var sltCity = document.getElementById('sltCity');

 for(var key in cities){
     var opt = document.createElement('option');
     opt.value= cities[key].id;
     opt.innerText = cities[key].name;
     sltCity.appendChild(opt)
 }

</script>
</html>